load("@rules_go//go:def.bzl", "go_library")
load(":def.bzl", "ANALYZERS")

go_library(
    name = "staticcheck",
    srcs = ["staticcheck.go"],
    importpath = "github.com/pachyderm/pachyderm/v2/src/internal/analyzers/staticcheck",
    visibility = ["//src:__subpackages__"],
    deps = [
        "@co_honnef_go_tools//analysis/lint",
        "@co_honnef_go_tools//simple",
        "@co_honnef_go_tools//staticcheck",
        "@co_honnef_go_tools//stylecheck",
        "@co_honnef_go_tools//unused",
        "@org_golang_x_tools//go/analysis",
    ],
)

[
    go_library(
        name = analyzer,
        srcs = ["staticcheck.go"],
        importpath = "github.com/pachyderm/pachyderm/v2/src/internal/analyzers/staticcheck/" + analyzer,
        visibility = ["//:__pkg__"],
        x_defs = {"name": analyzer},
        deps = [
            "@co_honnef_go_tools//analysis/lint",
            "@co_honnef_go_tools//simple",
            "@co_honnef_go_tools//staticcheck",
            "@co_honnef_go_tools//stylecheck",
            "@co_honnef_go_tools//unused",
            "@org_golang_x_tools//go/analysis",
        ],
    )
    for analyzer in ANALYZERS
]
